/**
 * 日志表
 * 
 */

const Sequelize = require('sequelize');
const MySQLManager = require('../utils/MySQLManager');

const Log = MySQLManager.define('log', {
    // // 创建时间戳
    // create_time: {
    //   type: Sequelize.INTEGER,
    //   allowNull: false,
    //   defaultValue: Sequelize.NOW()
    // },
    //   请求用户名
	  user_name: {
		type: Sequelize.STRING,
		allowNull: false
      },
    //   请求ip
	  user_ip: {
		type: Sequelize.STRING,
		allowNull: false,
		defaultValue: '123'
      },
    //   请求路径
	  request_url: {
		type: Sequelize.STRING,
		allowNull: false,
      },
    //   请求参数
	  request_parameter: {
          type: Sequelize.STRING(1024),
          allowNull: true
      },
    //   请求方法
	  request_method: {
        type: Sequelize.STRING,
        allowNull: false
      },
    //   请求模块
      request_module: {
        type: Sequelize.STRING,
        allowNull: false
      },
    //   行为
      request_behavior: {
        type: Sequelize.STRING,
        allowNull: false
      },
    //   结果
      request_status: {
        type: Sequelize.STRING,
        allowNull: false
      },
    //   备用字段
	  beiyong1: {
		type: Sequelize.STRING
	  },
	  beiyong2: {
		type: Sequelize.STRING
	  },
	  beiyong3: {
		type: Sequelize.STRING
      },
      beiyong4: {
		type: Sequelize.STRING
      },
      beiyong5: {
		type: Sequelize.STRING
      },
      beiyong6: {
		type: Sequelize.STRING
      },
      beiyong7: {
		type: Sequelize.STRING
      },
      beiyong8: {
		type: Sequelize.STRING
      },
      beiyong9: {
		type: Sequelize.STRING
      },
      beiyong10: {
		type: Sequelize.STRING
	  }
});


module.exports = Log;

